import {HStack, Pressable, Text, View} from "@gluestack-ui/themed";
import {Request} from "@/types/utils";
import React from "react";
import Swiper from "react-native-swiper";
import {ChartData} from "@/types/chart";
import {EChartsOption} from "echarts";
import {Option} from "@/types/public";


export interface DataPanelInterface {
    refresh: () => void;
}


export interface DataPanelProps extends Request<any>, React.ComponentProps<typeof View> {
    name: string;
    chartApi: Request<any>["api"];
    valueKey?: string;
}

export interface DataSwiperProps<L> extends React.ComponentProps<typeof Swiper> {
    list: L[];
    sliceNum: number;
    activeFields: string[];
    disabled?: boolean;
    onChange: (f: string) => void;
    data?: Record<string, any>;
    valueKey: string;
}

export interface DataSwiperParams {
    fields?: string[];
    report_time_range: string;
    channel: number;
}

export interface DataItemsProps {
    data: any;
    list: any[];
    actives: string[];
    disabled?: boolean;
    onClick: (f: string) => void
}

export interface LineChartProps<P> extends Request<ChartData, P> {
    show?: boolean;
    themeColors?: string[];
    labelMaps: Record<string, string>;
    height?: number;
}

export interface LineChartState<C> {
    chartData: ChartData | null;
    chart: C | null;
    options: EChartsOption;
    width: number;
    finish: boolean;
}
